package com.example.apple.hxbtc.fragment;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

/**
 * Created by hpz on 17/2/23.
 */
public class StudyListPagerAdapter extends FragmentPagerAdapter {
    private String[] mTitles = new String[]{"", "","","",""};
    private int[] datas = null;

    public StudyListPagerAdapter(FragmentManager fm, int[] datas) {
        super(fm);

        this.datas = datas;
    }

    @Override
    public Fragment getItem(int position) {
        Fragment fragment = null;
        switch (position) {
            case 0:
                fragment = new MessageFragment();
                break;
            case 1:
                fragment = new BuyFragment();
                break;
            case 2:
                fragment = new SellFragment();
                break;
            case 3:
                fragment = new NoVolFragment();
                break;
            case 4:
                fragment = new HistoryFragment();
                break;
        }

        return fragment;
    }

    @Override
    public int getCount() {
        return mTitles.length;
    }

    @Override
    public CharSequence getPageTitle(int position) {
        return mTitles[position];
    }
}
